
<script>
    let ws = new WebSocket("wss://iot.dog8.cc/wss");
    console.log(ws);
    ws.onopen = function() {
        let data = {type:'bindUser',uid:4}
        ws.send(JSON.stringify(data));
    };
    ws.onmessage = function(e) {
        console.log("收到服务端的消息：" + e.data);
    };
</script>